package com.ruoyi.housing.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.housing.mapper.CityDao;
import com.ruoyi.housing.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author 小智
 * @PachageName:com.ruoyi.housing.service.impl
 * @ClassName :CityServiceImpl
 * @Description:
 * @date 2021/07/28 10:29
 */
@Service
public class CityServiceImpl implements CityService {

    @Autowired
    CityDao cityDao;
    @Override
    public List<Map<String, Object>> queryRegionList(Map<String, Object> map) {
        return cityDao.queryRegionList(map);
    }

    @Override
    public Object findPageByFs(Map<String, Object> map) {
        PageHelper.startPage(
                Integer.valueOf(map.get("pageNum").toString()),
                Integer.valueOf(map.get("pageSize").toString())
        );
        List<Map<String, Object>> pageByFs = cityDao.findPageByFs(map);
        return new PageInfo<Map<String,Object>>(pageByFs);
    }
}
